<?php
use app\modules\clinical\models\Patient;
use app\modules\clinical\models\ExcelPd;

$append = ExcelPd::getMedList('pd');
$med = $model->excel->getMedCtns();

$params = ExcelPd::getParams();
?>

  <!-- 第二部分 -->
  <tr class="title">
      <td colspan="6"><h4>一、患者信息与表格信息</h4></td>
  </tr>
  <tr>
      <th>姓名</th>
      <td><?= Patient::findOne(['pk_id'=>$model->pt_id])->pt_name ?></td>
      <th>与患者关系</th>
      <td colspan="3"><?= ($model->rel_id == 0) ? '本人' : Patient::getParams('relation')[$rel[$model->pt_id]] ?></td>
  </tr>
  <tr>
      <th>创建人</th>
      <td><?= $model->crt_name ?></td>
      <th>创建时间</th>
      <td colspan="3"><?= $model->crt_time ?></td>
  </tr>
  <tr>
      <th>修改人</th>
      <td><?= $model->update_name ?></td>
      <th>修改时间</th>
      <td colspan="3"><?= $model->update_at ?></td>
  </tr>
  <tr>
      <th>评估日期</th>
      <td colspan="5"><?= $model->evaluation_time ?></td>
  </tr>
  <tr class="title">
      <td colspan="6"><h4>二、疾病信息</h4></td>
  </tr>
  <tr>
      <th>首次起病时间</th>
      <td><?= date("Y-m", $model->excel->ft_ill_time) ?></td>
      <th>首次起病部位</th>
      <td><?= $model->excel->getString($model->excel->ft_part, 'illPart') ?></td>
      <th>H-Y分级</th>
      <td><?= $model->excel->classify ?></td>
  </tr>
  <tr>
      <th>首次起病症状</th>
      <td colspan="5"><?= $model->excel->ft_symptom ?></td>
  </tr>
  <tr>
      <th>病情进展过程</th>
      <td colspan="5"><?= $model->excel->ft_process ?></td>
  </tr>

  <!-- 第三部分 -->
  <tr class="title">
      <td colspan="6"><h4>三、治疗信息</h4></td>
  </tr>
  <tr>
      <th>首次用药时间</th>
      <td><?= date("Y-m", $model->excel->ft_md_time) ?></td>
      <th>起床时间</th>
      <td><?= $model->excel->up_time ?></td>
      <th>早餐时间</th>
      <td ><?= $model->excel->bf_time ?></td>
  </tr>
  <tr>
      <th>中餐时间</th>
      <td ><?= $model->excel->lc_time ?></td>
      <th>晚餐时间</th>
      <td><?= $model->excel->dn_time ?></td>
      <th>睡觉时间</th>
      <td ><?= $model->excel->sl_time ?></td>
  </tr>
  <tr>
      <td colspan="6" class="medCtn-view">
      <table class="table-bordered">
      <tr>
          <td rowspan="2"><b>药物名称</b></td>
          <td colspan="7"><b>上午</b></td>
          <td colspan="10"><b>下午</b></td>
      </tr>
      <tr>
      <?php for ($i = 6; $i < 23; $i ++) : ?>
          <td><?= $i ?></td>
      <?php endfor;?>
      </tr>
      <?php foreach ($append as $list) : ?>
      <tr>
          <td><?= $list['med_name'] ?></td>
          <?php for ($i = 6; $i < 23; $i ++) : ?>
              <td><?= empty($med[$list['pk_id']][$i]) ? '' : $med[$list['pk_id']][$i] ?></td>
          <?php endfor; ?>
      </tr>
      <?php endforeach; ?>
      </table>
      </td>
  </tr>
  <tr>
      <th>其他用药情况</th>
      <td colspan="5"><?= $model->excel->else_ctnt ?></td>
  </tr>
  <tr>
      <th>手术治疗</th>
      <td colspan="5"><?= $model->excel->getString($model->excel->treatment, 'operation') ?></td>
  </tr>
  <tr>
      <th colspan="5">1. 白天流口水</th>
      <td><?= ($model->excel->q_1 != '') ? $params['yesno'][$model->excel->q_1] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">2. 味觉或嗅觉功能减退</th>
      <td><?= ($model->excel->q_2 != '') ? $params['yesno'][$model->excel->q_2] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">3. 吞咽困难或呛咳</th>
      <td><?= ($model->excel->q_3 != '') ? $params['yesno'][$model->excel->q_3] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">4. 恶心或呕吐</th>
      <td><?= ($model->excel->q_4 != '') ? $params['yesno'][$model->excel->q_4] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">5. 便秘（一周少于三次排便）或排大便困难</th>
      <td><?= ($model->excel->q_5 != '') ? $params['yesno'][$model->excel->q_5] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">6. 大便失禁</th>
      <td><?= ($model->excel->q_6 != '') ? $params['yesno'][$model->excel->q_6] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">7. 排便后有未排净的感觉</th>
      <td><?= ($model->excel->q_7 != '') ? $params['yesno'][$model->excel->q_7] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">8. 尿急</th>
      <td><?= ($model->excel->q_8 != '') ? $params['yesno'][$model->excel->q_8] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">9. 夜间较规律的起床排尿</th>
      <td><?= ($model->excel->q_9 != '') ? $params['yesno'][$model->excel->q_9] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">10. 不能解释的疼痛（排除由其他疾病引起的痛，如关节炎）</th>
      <td><?= ($model->excel->q_10 != '') ? $params['yesno'][$model->excel->q_10] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">11. 不能解释的体重变化（体重减轻不是因为改变饮食）</th>
      <td><?= ($model->excel->q_11 != '') ? $params['yesno'][$model->excel->q_11] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">12. 对近期发生的事情记忆有困难，或忘记做一些事</th>
      <td><?= ($model->excel->q_12 != '') ? $params['yesno'][$model->excel->q_12] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">13. 对周围发生的事情失去兴趣，或者没有兴趣做事情</th>
      <td><?= ($model->excel->q_13 != '') ? $params['yesno'][$model->excel->q_13] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">14. 看到或听到周围并不存在的东西</th>
      <td><?= ($model->excel->q_14 != '') ? $params['yesno'][$model->excel->q_14] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">15. 难以集中精神</th>
      <td><?= ($model->excel->q_15 != '') ? $params['yesno'][$model->excel->q_15] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">16. 感觉悲哀、情绪低落</th>
      <td><?= ($model->excel->q_16 != '') ? $params['yesno'][$model->excel->q_16] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">17. 感觉焦虑、恐惧、恐慌</th>
      <td><?= ($model->excel->q_17 != '') ? $params['yesno'][$model->excel->q_17] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">18. 性欲减退或性欲增强</th>
      <td><?= ($model->excel->q_18 != '') ? $params['yesno'][$model->excel->q_18] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">19. 性生活困难</th>
      <td><?= ($model->excel->q_19 != '') ? $params['yesno'][$model->excel->q_19] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">20. 从卧位或坐位站立时觉得头晕、头轻或乏力</th>
      <td><?= ($model->excel->q_20 != '') ? $params['yesno'][$model->excel->q_20] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">21. 摔倒</th>
      <td><?= ($model->excel->q_21 != '') ? $params['yesno'][$model->excel->q_21] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">22. 常在一些场合打盹，如开会、开车、吃饭时</th>
      <td><?= ($model->excel->q_22 != '') ? $params['yesno'][$model->excel->q_22] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">23. 夜间入睡困难或容易醒</th>
      <td><?= ($model->excel->q_23 != '') ? $params['yesno'][$model->excel->q_23] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">24. 做梦多，梦境很逼真，或经常做噩梦</th>
      <td><?= ($model->excel->q_24 != '') ? $params['yesno'][$model->excel->q_24] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">25. 睡梦时说梦话或舞动肢体，好像在扮演梦中的角色</th>
      <td><?= ($model->excel->q_25 != '') ? $params['yesno'][$model->excel->q_25] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">26. 夜间或休息时双下肢不适感，需不断活动才能缓解症状</th>
      <td><?= ($model->excel->q_26 != '') ? $params['yesno'][$model->excel->q_26] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">27. 腿部水肿</th>
      <td><?= ($model->excel->q_27 != '') ? $params['yesno'][$model->excel->q_27] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">28. 多汗</th>
      <td><?= ($model->excel->q_28 != '') ? $params['yesno'][$model->excel->q_28] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">29. 复视，看东西重影</th>
      <td><?= ($model->excel->q_29 != '') ? $params['yesno'][$model->excel->q_29] : '' ?></td>
  </tr>
  <tr>
      <th colspan="5">30. 总觉得一些事情要发生，尽管这些担心并不存在</th>
      <td><?= ($model->excel->q_30 != '') ? $params['yesno'][$model->excel->q_30] : '' ?></td>
  </tr>
